
import http from "../index";
import { PORT1 } from "../config/servicePort";
import { User } from "../interface";

export const addArticle = (params:any)=>{
    return http.post<any>(PORT1 + '/article/add', params);
};
export const getArticleList = (params:User.FindPage) => {
    return http.get<User.FindPage>(PORT1 + `/article/list`, params);
};

export const deleteArticle = (id:number)=>{
    return http.delete(PORT1 + `/article/del/${id}`);
};

export const getOneArticle = (id:string)=>{
    return http.get(PORT1 + `/article/${id}`);
};

export const getComments = (articleId:string)=>{
    return http.get(PORT1 + `/comment/tree/${articleId}`);
};

